import { defHttp } from '/@/utils/http/axios'
import { MeasurePoint } from './model/measurePoint'

import { ErrorMessageMode } from '/#/axios'

enum Api {
  List = '/measurePoint/measurePoint/list',
  Edit = '/measurePoint/measurePoint',
}

/**
 * @description: 获取列表
 */
export function ListApi(mode: ErrorMessageMode = 'modal') {
  return defHttp.get<Array<MeasurePoint>>(
    {
      url: Api.List,
    },
    {
      errorMessageMode: mode,
    },
  )
}

/**
 * @description: 修改
 */
export function EditApi(params: MeasurePoint, mode: ErrorMessageMode = 'modal') {
  return defHttp.put<Array<MeasurePoint>>(
    {
      url: Api.Edit,
      params,
    },
    {
      errorMessageMode: mode,
    },
  )
}
